<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>Document</title>
</head>
<body>
  
  <script src="./axios.min.js"></script>
  <script>
    // https://www.kancloud.cn/yunye/axios/234845
    // console.log(axios)
    // axios.get('http://localhost/ajax/CORS.php?a=1').then(function (res) {})
    /* axios.get('http://localhost/ajax/CORS.php?a=1').then((res) => {
      // res.data才是axios获取到的真正的数据
      console.log(res.data)
    }) */

    axios.get('http://localhost/ajax/CORS.php', {
      params: {
        a: 1
      }
    }).then(res=>res.data).then(data => {
      console.log(data)
    })


    // axios.post('url', {参数1: 值1})

    /* function (res) {
      return res.data
    } */
  </script>
</body>
</html>